import React, { Component } from 'react'

export default class App extends Component {
  state={
    uname:''
  }
  doUnameChange=(e)=>{
    console.log(e.target.value);
    // let uname=e.target.value.toUpperCase().trim().substring(0,6)
    let uname=e.target.value.toUpperCase()
    // let uname=parseInt( e.target.value)
    // if(!isNaN(uname)){
    //   this.setState({uname})
    // }else{
    //   this.setState({uname:''})
    this.setState({uname})
    }
    
  
  render() {
    return (
      <div>
        <input value={this.state.uname} onChange={this.doUnameChange}/>
        <hr/>
        <span>用户当前的输入:{this.state.uname}</span>
      </div>
    )
  }
}
